home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-12 | 5.2 KB | 151 lines | [TEXT/CCL2] |
-
- (in-package :TRAPS) ; ***********************************************************
- ;
- ; Created: Sunday, February 7, 1993 at 4:54PM
- ; ADSPSecure.p
- ; Pascal Interface to the Macintosh Libraries
- ;
- ; ••• Apple Confidential •••
- ; ••• Provided with AOCE Beta seed under license agreement with •••
- ; ••• Apple Computer, Inc. Use for any purpose other than •••
- ; ••• development of AOCE-based Macintosh products is a violation •••
- ; ••• of the license agreement. •••
- ;
- ; Copyright Apple Computer, Inc. 1990-1993
- ; All rights reserved
- ;
- ; ***********************************************************
-
- ; $IFC UNDEFINED UsingIncludes
- ; $SETC UsingIncludes:= 0
- ; $ENDC
-
- ; $IFC NOT UsingIncludes
-
- ; $ENDC
-
- ; $IFC UNDEFINED UsingADSPSecure
- ; $SETC UsingADSPSecure:= 1
-
- ; $I+
- ; $SETC ADSPSecureIncludes:= UsingIncludes
- ; $SETC UsingIncludes:= 1
-
- ; $IFC UNDEFINED UsingADSP
-
- (require-interface 'ADSP) ; $I $$Shell(PInterfaces)ADSP.p
- ; $ENDC
-
- ; $IFC UNDEFINED UsingFiles
-
- (require-interface 'FILES) ; $I $$Shell(PInterfaces)Files.p
- ; $ENDC
-
- ; $IFC UNDEFINED UsingOCE
- ; $I OCE.p
- ; $ENDC
-
- ; $IFC UNDEFINED UsingOCEAuthDir
- ; $I OCEAuthDir.p
- ; $ENDC
-
- ; $IFC UNDEFINED UsingTypes
-
- (require-interface 'TYPES) ; $I $$Shell(PInterfaces)Types.p
- ; $ENDC
-
- ; $SETC UsingIncludes:= ADSPSecureIncludes
-
- ; New ADSP control codes
-
- (defconstant $sdspOpen 229) ; open a secure connection
-
- ;
- ; For secure connections, the eom field of ioParams contains two single-bit flags
- ; (instead of a zero/non-zero byte). They are an encrypt flag (see below), and an
- ; eom flag. All other bits in that field should be zero.
- ;
- ; To write an encrypted message, you must set an encrypt bit in the eom field of
- ; the ioParams of your write call. Note: this flag is only checked on the first
- ; write of a message (the first write on a connection, or the first write following
- ; a write with eom set.
- ;
-
- (defconstant $dspEOMBit 0) ; set if EOM at end of write
- (defconstant $dspEncryptBit 1) ; set to encrypt message
-
- (defconstant $dspEOMMask #X1) ; 1<<dspEOMBit
- (defconstant $dspEncryptMask #X2); 1<<dspEncryptBit
-
- ;
- ; Define an ADSPSecure parameter block, as used for the secure Open call.
- ;
-
- (defconstant $sdspWorkSize 2048); size of ADSPSecure workspace
-
- (defrecord TRSecureParams
- (localCID :SIGNED-INTEGER) ; local connection id
- (remoteCID :SIGNED-INTEGER) ; remote connection id
- (remoteAddress :ADDRBLOCK) ; address of remote end
- (filterAddress :ADDRBLOCK) ; address filter
- (sendSeq :SIGNED-LONG) ; local send sequence number
- (sendWindow :SIGNED-INTEGER) ; send window size
- (recvSeq :SIGNED-LONG) ; receive sequence number
- (attnSendSeq :SIGNED-LONG) ; attention send sequence number
- (attnRecvSeq :SIGNED-LONG) ; attention receive sequence number
- (ocMode :UNSIGNED-BYTE) ; open connection mode
- (ocInterval :UNSIGNED-BYTE) ; open connection request retry interval
- (ocMaximum :UNSIGNED-BYTE) ; open connection request retry maximum
-
- ; ERROR!! Record field SECURE declared PACKED BOOLEAN !
- (secure :BOOLEAN) ; --> TRUE if session was authenticated
- (sessionKey (:POINTER :AUTHKEY)); <--> encryption key for session
- (credentialsSize :SIGNED-LONG); --> length of credentials
- (credentials :POINTER) ; --> pointer to credentials
- (workspace :POINTER) ; --> pointer to workspace for connection
- ; align on even boundary and length = sdspWorkSize
- (recipient :SIGNED-LONG) ; --> identity of recipient (or initiator if active mode
- (issueTime :SIGNED-LONG) ; --> when credentials were issued
- (expiry :SIGNED-LONG) ; --> when credentials expiry
- (initiator (:POINTER :RECORDID)); <-- RecordID of initiator returned here.
- ; Must give appropriate Buffer to hold RecordID
- ; (Only for passive or accept mode)
-
- ; ERROR!! Record field HASINTERMEDIARY declared PACKED BOOLEAN !
- (hasIntermediary :BOOLEAN) ; <-- will be set if credentials has an intermediary
- (intermediary (:POINTER :RECORDID)); <-- RecordID of intermediary returned here.
- ; (If intermediary is found in credentials
- ; Must give appropriate Buffer to hold RecordID
- ; (Only for passive or accept mode)
- )
-
- (defrecord SDSPParamBlock
- (:variant
- ((DSPParamBlock :DSPPARAMBLOCK))
- ((qLink (:POINTER :QELEM))
- (qType :SIGNED-INTEGER)
- (ioTrap :SIGNED-INTEGER)
- (ioCmdAddr :POINTER)
- (ioCompletion :POINTER)
- (ioResult :SIGNED-INTEGER)
- (ioNamePtr (:POINTER (:STRING 255)))
- (ioVRefNum :SIGNED-INTEGER)
- (ioCRefNum :SIGNED-INTEGER); adsp driver refNum
- (csCode :SIGNED-INTEGER) ; adsp driver control code
- (qStatus :SIGNED-LONG) ; adsp internal use
- (ccbRefNum :SIGNED-INTEGER); connection end refNum
- (secureParams :TRSECUREPARAMS); dspOpenSecure
- )
- ))
-
- (def-mactype :SDSPPBPTR (find-mactype :POINTER))
-
- ; $ENDC ; UsingADSPSecure
-
- ; $IFC NOT UsingIncludes
-
- ; $ENDC
-
- (export '($SDSPWORKSIZE $DSPENCRYPTMASK $DSPEOMMASK $DSPENCRYPTBIT $DSPEOMBIT
- $SDSPOPEN))
- (provide-interface 'ADSPSecure)